import javax.microedition.io.Connector;
import javax.microedition.io.ServerSocketConnection;
import javax.microedition.io.SocketConnection;
import javax.microedition.lcdui.Form;

public class PlayOne
{
  public static Game start(Form log, String port, String nome)
    throws Exception
  {
    ServerSocketConnection conn = (ServerSocketConnection)
      Connector.open("socket://:" + port);
    log.append("IP: " + conn.getLocalAddress() + "\n");
    log.append("Aguardando Player 2...");
    SocketConnection con = (SocketConnection)conn.acceptAndOpen();
    Game g = new Game(con.openInputStream(), con.openOutputStream(), 1, nome);
    return g;
  }
}